/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package XMLParsing;

import java.util.ArrayList;
import java.util.List;
import supervise.Element;
import supervise.Ensemble;

/**
 *
 * @author mida
 */
public class Groupe {

    int num;
    List ontClasses;
    List ontObjectProperties;
    List ontDataTypeProperties;

    int getNum() {
        return num;
    }

    Groupe() {
        ontClasses = new ArrayList();
        ontObjectProperties = new ArrayList();
        ontDataTypeProperties = new ArrayList();
    }

    void setNum(int num) {
        this.num = num;
    }

    void addClasse(ontClasse a) {
        ontClasses.add(a);
    }

    void addObjectProperty(ObjectProperty a) {
        ontObjectProperties.add(a);
    }

    void addDataTypeProperty(DataTypeProperty a) {
        ontDataTypeProperties.add(a);
    }

    @Override
    public String toString() {
        StringBuffer buf = new StringBuffer("Groupe: Num='" + num + "' ");
        for (int i = 0; i < ontClasses.size(); i++) {
            buf.append(ontClasses.get(i).toString());
        }
        for (int i = 0; i < ontObjectProperties.size(); i++) {
            buf.append(ontObjectProperties.get(i).toString());
        }
        for (int i = 0; i < ontDataTypeProperties.size(); i++) {
            buf.append(ontDataTypeProperties.get(i).toString());
        }
        return buf.toString();
    }

    Ensemble toEnsemble() {
        Ensemble ens = new Ensemble(num);
        for (int i = 0; i < ontClasses.size(); i++) {
            ens.add(new Element(ontClasses.get(i).toString()));
        }
        return ens;
    }
}
